/*
 *  Copyright 2009 Coditate Software
 *  Licensed under the GNU Library General Public License (LGPL) 2.1 
 *  
 *  License available at: http://simplesavant.codeplex.com/license
 */
using System.Collections.Generic;

namespace Coditate.Savant
{
    /// <summary>
    /// Defines the strongly-typed SimpleSavant methods for interacting with SimpleDB.
    /// </summary>
    /// <seealso cref="SimpleSavant"/>
    /// <seealso cref="SavantConfig"/>
    /// <seealso cref="SelectCommand"/>
    /// <seealso cref="ISimpleSavant2"/>
    /// <remarks>
    /// See the documentation on <see cref="SimpleSavant"/> for more detailed usage instructions.
    /// </remarks>
    public interface ISimpleSavant
    {
        /// <summary>
        /// Puts one or more items into SimpleDB.
        /// </summary>
        void Put(params object[] items);

        /// <summary>
        /// Puts one or more lists of item values into SimpleDB.
        /// </summary>
        void PutAttributes<T>(params PropertyValues[] values);

        /// <summary>
        /// Gets a item from SimpleDB.
        /// </summary>
        T Get<T>(object itemName);

        /// <summary>
        /// Gets a list of item values from SimpleDB.
        /// </summary>
        PropertyValues GetAttributes<T>(object itemName, params string[] propertyNames);

        /// <summary>
        /// Deletes an item from SimpleDB (all attributes).
        /// </summary>
        void Delete<T>(object itemName);

        /// <summary>
        /// Deletes a list of item values from SimpleDB.
        /// </summary>
        void DeleteAttributes<T>(object itemName, params string[] propertyNames);

        /// <summary>
        /// Executes the specified select statement against SimpleDB using default options
        /// and returns a list of items.
        /// </summary>
        List<T> Select<T>(string selectStatement, params CommandParameter[] selectParams);

        /// <summary>
        /// Executes the specified select statement against SimpleDB using default options
        /// and returns a list of item values.
        /// </summary>
        List<PropertyValues> SelectAttributes<T>(string selectStatement, params CommandParameter[] selectParams);

        /// <summary>
        /// Executes the specified select statement against SimpleDB
        /// using advanced options provided by the command object.
        /// </summary>
        SelectResults<T> Select<T>(SelectCommand<T> command);

        /// <summary>
        /// Executes the specified select statement against SimpleDB
        /// using advanced options provided by the command object.
        /// </summary>
        SelectResults<PropertyValues> SelectAttributes<T>(SelectCommand<T> command);

        /// <summary>
        /// Executes the specified select statement against SimpleDB using default options
        /// and returns only the first attribute value in the result set.
        /// </summary>
        object SelectScalar<T>(string selectStatement, params CommandParameter[] selectParams);

        /// <summary>
        /// Searches the full-text index with a specified query string and returns all items that still
        /// exist in SimpleDB.
        /// </summary>
        /// <returns></returns>
        List<T> Find<T>(string queryText, int resultStartIndex, int resultCount, string searchProperty);

        /// <summary>
        /// Searches the full-text index with a specified query string and returns all items that still
        /// exist in SimpleDB.
        /// </summary>
        /// <returns></returns>
        List<PropertyValues> FindAttributes<T>(string queryText, int resultStartIndex, int resultCount,
                                               string searchProperty, params string[] propertyNames);
    }
}